﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;
using System.Text;

namespace IHISCETeim.Web.MachineSys.FTradeModel
{
    public partial class FTradeWarehouseFeeEdit : PageBase
    {

        protected string Action
        {
            get {
                return GetRequestValue<string>("Action", "add");
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "FTradeWarehouseFeeList";
            }
        }

        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.新增 };
            }
        }

        protected int ID
        {
            get
            {

                return GetRequestValue<int>("ID", 0);
            }
        }
        private FTradeWarehouseFeeInfo _obj = null;
        protected FTradeWarehouseFeeInfo obj
        {
            get
            {
                if (_obj == null)
                    _obj = FTradeWarehouseFeeController.GetList(ID);
                return _obj;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                addmenu();

            }
        }
        private void addmenu()
        {
            FTradeWarehouseFeeInfo _obj = Request.SerializableObject<FTradeWarehouseFeeInfo>();
            _obj.AddRealName = base.User.RealName;

            int msg = FTradeWarehouseFeeController.Add(_obj);

          //  AddLog(Permission.新增, obj);

            if (msg > 0)
                SuccessJson("新增成功", DWZRef);
            else
            {

                ErrorJson("新增失败");
            }
        }
    }
}